<section class="scrollable padder-md" data-ng-controller="AdminMenuListController">
    <div class="m-b-md">
        <h3 class="m-b-none text-black">
            <i class="fa fa-list m-r-sm"></i>后台基础配置
        </h3>
    </div>
    <!-- Toolbar 按钮栏 -->
    <section class="panel panel-default scrollable">
        <header class="panel-heading">
            <div class="row">
                <div class="col-sm-5">
                    <div class="od-head-title">菜单管理</div>
                </div>
            </div>
        </header>

        <form class="form-inline" data-ng-submit="getObjList()">
            <div class="wrapper row">
                <div class="col-sm-12 text-right">
                    <div class="form-group">
                        <button class="form-control btn btn-sm btn-success " type="button" data-ng-click="add()">新增</button>
                    </div>
                </div>
            </div>
        </form>
        <!-- 表格部分 -->
        <div class="table-responsive">
            <table class="table table-striped b-t b-light">
                <thead>
                <tr>
                    <th>ID</th>
                    <th>菜单名称</th>
                    <th>图标</th>
                    <th>链接</th>
                    <th>状态</th>
                    <th>排序</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody data-ng-repeat="adminMenu in adminMenuList" class="no-border"
                       ng-init="adminMenu.isExpand=true">
                <tr>
                    <td>{{adminMenu.id}}</td>
                    <td ng-click="adminMenu.isExpand=!adminMenu.isExpand" class="pointer">
                        <span ng-if="adminMenu.children.length>0">
                            <i class="fa fa-plus-square-o m-r-xs" ng-if="!adminMenu.isExpand"></i>
                            <i class="fa fa-minus-square-o m-r-xs" ng-if="adminMenu.isExpand"></i>
                        </span>
                        {{adminMenu.menuName}}
                    </td>
                    <td><i class="m-r-xs" ng-class="adminMenu.icon"></i>{{adminMenu.icon}}</td>
                    <td>{{adminMenu.linkUrl}}</td>
                    <td>
                        <span data-ng-if="adminMenu.enable" class="badge bg-success">正常</span>
                        <span data-ng-if="!adminMenu.enable" class="badge bg-danger">禁用</span>
                    </td>
                    <td>{{adminMenu.orderIndex}}</td>
                    <td>
                        <a href="javascript:void(0);" class="text-primary m-r-xs"
                           data-ng-click="edit(adminMenu.id)"><i class="fa fa-edit"></i>编辑</a>
                        <a href="javascript:void(0);" class="text-primary m-r-xs" data-ng-click="add(adminMenu.id)"><i
                                class="fa fa-plus"></i>添加子菜单</a>
                        <a href="javascript:void(0);" class="text-danger m-r-xs"
                           data-ng-click="delete(adminMenu.id)"><i class="fa fa-trash-o"></i>删除</a>
                    </td>
                </tr>
                <tr data-ng-repeat="subMenu in adminMenu.children" ng-if="adminMenu.isExpand">
                    <td></td>
                    <td>{{subMenu.menuName}}</td>
                    <td><i class="m-r-xs" ng-class="subMenu.icon"></i>{{subMenu.icon}}</td>
                    <td>{{subMenu.linkUrl}}</td>
                    <td>
                        <span data-ng-if="subMenu.enable" class="badge bg-success">正常</span>
                        <span data-ng-if="!subMenu.enable" class="badge bg-danger">禁用</span>
                    </td>
                    <td>{{subMenu.orderIndex}}</td>
                    <td>
                        <a href="javascript:void(0);" class="text-primary m-r-xs"
                           data-ng-click="edit(subMenu.id)"><i class="fa fa-edit"></i>编辑</a>
                        <a href="javascript:void(0);" class="text-danger m-r-xs" data-ng-click="delete(subMenu.id)"><i
                                class="fa fa-trash-o"></i>删除</a>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </section>
</section>
